package com.example.tivi.entity;

import java.io.Serializable;
import java.util.List;

public class GlobalInfor implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = -3579704105325449799L;

	private static GlobalInfor mGlobalInfor = new GlobalInfor();

	public static GlobalInfor getInstance() {
		return mGlobalInfor;
	}

	private List<Category> mCategoryList;

	public List<Channel> getChannelList(int categoryId) {
		for (Category category : mCategoryList) {
			if (category.getId() == categoryId) {
				return category.getChannels();
			}
		}
		return null;
	}

	public List<Category> getCategoryList() {
		return mCategoryList;
	}

	public void setCategoryList(List<Category> list) {
		mCategoryList = list;
	}

	@Override
	public String toString() {
		return new StringBuffer("List: ").append(mCategoryList).toString();
	}
}
